package com.bw.singleton;

/**
 * 单列模式
 * 懒汉式
 */
public class SingletonS {
    private static  A a = null;
    private SingletonS(){}
    public static A getA(){
        if(a != null){
            synchronized (a.getClass()){
                if(a != null){
                    a = new A();
                }
            }
        }
        return  a;
    }
}
